const {jwtAdminRouter, upload} = require('../../util')
const {server_port, image_host} = require('../../config')

let router = jwtAdminRouter()

// 上传图片
router.post('/', upload.single('file'), async (req, res, next) => {

    res.json({
        'ok': 1,
        'data': {
            'url': image_host + ':' + server_port + '/' + req.file.path
        }
    })
})

module.exports = router